﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utilities.Net
{
    public class Url
    {
        public static string Combine(string absoluteUrl, string relativeUrl)
        {
            absoluteUrl = new Uri(absoluteUrl).ToString();

            relativeUrl = Uri.EscapeUriString(relativeUrl);
            while (relativeUrl.StartsWith("/"))
                relativeUrl = relativeUrl.Substring(1);

            return absoluteUrl + "/" + relativeUrl;
        }
    }
}
